/* 
 * File:   Parser.h
 * Author: danielginting
 *
 * Created on April 29, 2011, 11:11 PM
 */

#ifndef PARSER_H
#define	PARSER_H

#include <string>
#include "../Facts/Facts.h"
#include "../Rules/Rules.h"
#include "../Parameter/Parameter.h"
#include <iostream>
#include <list>

using namespace std;

class Parser {
public:
    Parser();
    Parser(const Parser&);
    ~Parser();

    void ParseInput();

    void setLine(string s);

    string getLine();
    string getName();

	void transferInput();
	
	void setBeginIte();
	
	list<Facts*> * getFacts();
	bool isRules(string);
	
	void Parse(string S);
	void Print();
	void IgnoreBlank(string S, int* C);
	void Clear();

	int getJumParam();
	int getJumRel();
	void searchFR(string s);
	string getFR();
	string getNextFR();
	
	bool IsVariable(string);
	
	list<Facts*>::iterator ite;
	list<Facts*> fakta;

private:
    int num_of_param;
	int Jml_Param;
	int Jml_Rel;
	string Nama;	
	
	list<Facts*> dummies;
	string fact_name;
    string line;
	
	Facts * _temp_fact;
};


#endif	/* PARSER_H */

